
<%-------------------------------------------------------------------
 * 页面名称：ModifyAccountUserInfo.jsp
 * 功能描述：修改个人信息
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="struts-html.tld" prefix="html"%>
<%@ taglib uri="struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="struts-logic.tld" prefix="logic"%>
<%@ taglib uri="struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%@ page import="cn.agiledata.bank.common.util.Constant"%>
<%
String path = request.getContextPath();
%>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<SCRIPT LANGUAGE="javascript" src="<%=path%>/js/js.js"></SCRIPT>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/AccountLogic.js'></script>
<script language="javascript" type="text/javascript"
	src="<%=path%>/js/choiceCity.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript"
	src='<%=path%>/js/vnv/commonForManage.js' charset="UTF-8"></script>
<script language=javascript type='text/javascript'
	src="<%=path%>/js/popcalendar.js" charset="UTF-8"></script>
<SCRIPT LANGUAGE="JavaScript">
	function update() {
		AccountLogic.getCityList(createList, $("provSeq").value);
	}
	function createList(data) {
  		DWRUtil.removeAllOptions("citySeq");
  		DWRUtil.addOptions("citySeq", data,'cityId','cityName');
	}
	function init(){
		UFront.initPage();	
		DWREngine.setPreHook();
		DWREngine.setPostHook();
		var selectProv= document.all("provSeq");
		var selectCity= document.getElementById("citySeq");
		initChoiceCity (selectProv,selectCity);
	}
	function submitProcess() {
		var formName = document.forms["0"];
		if(checkNecessaryInput(formName)){
			if(getObj('bday').value != '' && calendarCompare(getObj('bday'),'beforeToday')==false){
				getObj('bday').focus();
				return;
			}
			if(formName.name!=undefined && formName.confirmName!=undefined){
				var name = formName.name.value;
				var confirmName = formName.confirmName.value;
				if(name!=undefined && name!="" && name!=confirmName){
					alert("真实姓名与确认姓名不一致，请重新填写！");
					formName.name.value="";
					formName.confirmName.value="";
					formName.name.focus();
					return;
				}
			}
			if(getObj('remark').value.length>30){
				alert("您填写的备注过长，请重新填写！");
				getObj('remark').value="";
				getObj('remark').focus();
				return;
			}
			formName.submit();
		}
	}
	function openPhoto(obj,property) {
	    var file = document.getElementById(obj).value;
	    if(file != "") {
	    	window.open('<%=path%>/page/common/showPhoto.action?formProperty='+file, '', 'height=400, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=yes,resizable=yes,location=no, status=no');
	    } else {
	    	window.open('<%=path%>/page/common/showPhoto.action?dbProperty='+property, '', 'height=400, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=yes,resizable=yes,location=no, status=no') 
	    }
	}
	function changePhoto(photoObj,obj) {
	  
	    if (changeFile(photoObj)){
			document.getElementById(obj).width = 100;
			document.getElementById(obj).height = 100;
			document.getElementById(obj).alt="";
			document.getElementById(obj).src=photoObj.value;
		}
	}
	 function changeFile(photoObj){  

    var photo = photoObj.value;  
    var phototext= photo.substring(photo.lastIndexOf("."),photo.length);  
    phototext= phototext.toLowerCase();  
    
    if(phototext!='.jpg'&&phototext!='.png'&&phototext!='.gif'){  
        alert("系统不支持的文件格式！\n请选择JPG/PNG/GIF类型图片。");  
              
         if (photoObj.outerHTML) {  
              photoObj.outerHTML = photoObj.outerHTML;
              //return;   
         } else {   
              photoObj.value = "";
              //return;  
         }  
         return false;
        }  
       return true;
    } 
</SCRIPT>
<div id="main">
	<div class="content_right">
		<div style="width:745px;margin-left:10px;">
			<div class="titleinfo">
				修改个人信息
			</div>
			<div style="margin-top: 20px;border:1px #CCCCCC solid;">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<html:form action="modifyAccountUserInfoSubmit" method="post"
						enctype="multipart/form-data">
						<tr>
							<td width="15%" height="40" align="right">
								Email地址：
							</td>
							<td>
								<bean:write name="account" property="email" />
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								真实姓名：
							</td><td>
							<logic:empty name="idcardStatus">
								
									您还未进行身份证认证，
									<a href="#"
										onclick="loading('<%=path%>/page/myspace/preSubmitIdcard.do');"
										>进行身份证认证</a>
							</logic:empty>
							<logic:equal name="idcardStatus"
								value="<%=Constant.AUTHENTICATION_STATUS_TOPUBMITTED%>">
                  您还未进行身份证认证，<a href="#"
									onclick="loading('<%=path%>/page/myspace/preSubmitIdcard.do');"
									>点击这里进行身份证认证</a>
							</logic:equal>
							<logic:equal name="idcardStatus"
								value="<%=Constant.AUTHENTICATION_STATUS_SUBMITTED%>">
     			您已经提交了身份证认证，正在审核中……
     		</logic:equal>
							<logic:equal name="idcardStatus"
								value="<%=Constant.AUTHENTICATION_STATUS_PASS%>">
								<bean:write name="account" property="name" />
							</logic:equal>
							<logic:equal name="idcardStatus"
								value="<%=Constant.AUTHENTICATION_STATUS_UNPASS%>">
				您的身份证认证未通过，<a href="#"
									onclick="loading('<%=path%>/page/myspace/preSubmitIdcard.do');"
									>点击这里重新进行身份证认证</a>
							</logic:equal>
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">性别：</span>
							</td>
							<td>
								<html:radio value="M" property="gender" style="border:0;" />
								男
								<html:radio value="F" property="gender" style="border:0;" />
								女
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">出生日期：</span>
							</td>
							<td>
								<ad:calendar property="bday" path="<%=path%>"
									calendarType="beforeToday" readonly="false" />
								&nbsp;&nbsp;&nbsp;&nbsp;
								<span class="text9green">例：2008-08-18 </span>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">电话号码：</span>
							</td>
							<td>
								<html:text property="tel" maxlength="20" styleClass="inputStyle"
									onblur="fixTelValidate(this)" />
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">手机号码：</span>
							</td>
							<td>
								<logic:empty name="account" property="mobile">您还未绑定手机</logic:empty>
								<logic:notEmpty name="account" property="mobile">
									<bean:write name="account" property="mobile" />
								</logic:notEmpty>
							</td>
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">所在省份：</span>
							</td>
							<td>
								<div class="select">
									<div>
										<html:select property="provSeq" styleId="provSeq" onchange="update()" alt="所在省份">
											<html:options collection="province" property="cityId"
												labelProperty="cityName" />
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">所在城市：</span>
							</td>
							<td>
								<div class="select">
									<div>
										<html:select property="citySeq" styleId="citySeq" alt="所在城市">
											<html:options collection="city" property="cityId"
												labelProperty="cityName" />
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">联系地址：</span>
							</td>
							<td>
								<html:text property="addr" maxlength="30" size="35"
									styleClass="inputStyle" />
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">邮政编码：</span>
							</td>
							<td>
								<html:text property="zipCode" maxlength="6"
									styleClass="inputStyle" />
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">客户类型：</span>
							</td>
							<td>
								<ad:write typeid="ACCOUNT_TYPE" name="account"
									property="accountType" />
							</td>
						</tr>
						<tr>
							<td height="40" align="right">
								<span class="subTitleBlue2">状态：</span>
							</td>
							<td>
								<ad:write typeid="CUSTOMER_STATUS" name="account"
									property="status" />
							</td>
						</tr>
						<tr>
							<td height="30" align="right" valign="top">
								<span class="subTitleBlue2">备注：</span>
							</td>
							<td>
								<html:textarea property="remark" rows="5" cols="45"
									style="border:1px solid #ccc;" />
								<br />
								<br />
							</td>
						</tr>
						<tr>
							<td height="30" align="right" valign="top">
								<span class="subTitleBlue2">上传照片：</span>
							</td>
							<td>
								<label>
									<html:file property="theFiles1" onkeydown="return false"
										size="45" styleClass="buttonStyle-nor inputStyle"
										onchange="changePhoto(this,'photo')" />
									<br />
									<span class="font_gray">(支持</span><span class="redColor12px">gif</span>,
									<span class="redColor12px">jpeg</span>,
									<span class="redColor12px">jpg</span><span class="font_gray">格式,大小不超过</span><span
										class="redColor12px">512K</span><span class="font_gray">)<br />
										<br /> <img id="photo" alt="照片"
											src="<%=path%>/page/common/showPhoto.action?dbProperty=photo&amp;compressSize=86"
											width="86" height="75" border="0" /> </span>
								</label>
							</td>
							</td>
						</tr>
						<tr>
							<td height="55" align="right" valign="top">
								&nbsp;
							</td>
							<td>
								<input type="button" name="sure" id="button2" value="确 定" class="button_style"
									onclick="submitProcess();" />
								<input type="button" name="return" id="button" class="button_style"
									value="返 回"
									onclick="
									loading('<%=path%>/route.do?modual=space$account&showTab=3');"  >
							</td>
						</tr>
					</html:form>
				</table>
			</div>
		</div>
	</div>